﻿using NLog.Web;
using NLog;

namespace DFGJ.WMS_PDA.WebAPI.Extensions
{   
    /// <summary>
    /// NLog扩展
    /// </summary>
    public static class NLogExtend
    {   
        /// <summary>
        /// 注入NLog 
        /// </summary>
        /// <param name="builder"></param>
        public static void AddNLogSetUp(this WebApplicationBuilder builder)
        {
            LogManager.Setup().LoadConfigurationFromFile("CfgFile/NLog.config").GetCurrentClassLogger();

            builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information);

            builder.Host.UseNLog();

        }

    }
}
